﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyKTV
{
    class Class1
    {
        public class DBHelper
        {
            private string connstring = "Data Source=127.0.0.1;Initial Catalog=MyKTV;User ID=sa;Password=123456@qwe";
            private SqlConnection connection;
            public SqlConnection Connection
            {
                get
                {
                    if (connection == null)
                    {
                        connection = new SqlConnection(connstring);
                    }
                    return connection;
                }
            }
            public void Openconnection()
            {
                if (Connection.State == ConnectionState.Closed)
                {
                    Connection.Open();
                }
                else if (Connection.State == ConnectionState.Broken)
                {
                    Connection.Close();
                    Connection.Open();
                }
            }

            internal SqlConnection getConn()
            {
                throw new NotImplementedException();
            }

            public void Closeconnection()
            {
                if (Connection.State == ConnectionState.Open || Connection.State == ConnectionState.Broken)
                {
                    Connection.Close();
                }
            }

            

            internal bool updExecute(string sql)
            {
                throw new NotImplementedException();
            }

            internal string updLJ(string v)
            {
                throw new NotImplementedException();
            }

            internal void DeleteDirectory(string v)
            {
                throw new NotImplementedException();
            }

            
        }
    }
}
